package com.glacier.cloud.cart.controller;

import com.glacier.cloud.cart.entity.dto.cmd.CartRemoveCmd;
import com.glacier.cloud.cart.service.CartItemService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * date 2023-12-04 10:35
 * 购物车
 *
 * @author glacier
 * @version 1.0
 */
@RestController
@RequestMapping("cart")
public class CartController {

    @Resource
    private CartItemService cartItemService;

    @PostMapping("removeProduct")
    public int removeProduct(@RequestBody CartRemoveCmd cartRemoveCmd) {
        return cartItemService.removeCart(cartRemoveCmd);
    }
}
